<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 任务积分设置 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\TaskscoreSet.name", default="fa_taskscore_set"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\TaskscoreSet.poolName"))
 * @DDL(sql="CREATE TABLE `fa_taskscore_set` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL COMMENT '任务名',
  `image` varchar(255) DEFAULT NULL COMMENT '图标',
  `score` decimal(10,2) DEFAULT NULL COMMENT '积分',
  `status` enum('2','1') DEFAULT NULL COMMENT '类型:2=每日任务,1=新生任务',
  `rand_status` enum('1','2') DEFAULT '1' COMMENT '积分类型:1=固定积分,2=区间积分',
  `range_score` varchar(255) DEFAULT NULL COMMENT '区间积分',
  `weigh` int(10) unsigned DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务积分设置'", decode="")
 *
 * @property int|null $id 
 * @property string|null $name 任务名
 * @property string|null $image 图标
 * @property string|float|int|null $score 积分
 * @property string|null $status 类型:2=每日任务,1=新生任务
 * @property string|null $randStatus 积分类型:1=固定积分,2=区间积分
 * @property string|null $rangeScore 区间积分
 * @property int|null $weigh 排序
 */
abstract class TaskscoreSetBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 任务名.
     * name
     * @Column(name="name", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $name = NULL;

    /**
     * 获取 name - 任务名.
     *
     * @return string|null
     */
    public function getName(): ?string
    {
        return $this->name;
    }

    /**
     * 赋值 name - 任务名.
     * @param string|null $name name
     * @return static
     */
    public function setName($name)
    {
        $this->name = null === $name ? null : (string)$name;
        return $this;
    }

    /**
     * 图标.
     * image
     * @Column(name="image", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $image = NULL;

    /**
     * 获取 image - 图标.
     *
     * @return string|null
     */
    public function getImage(): ?string
    {
        return $this->image;
    }

    /**
     * 赋值 image - 图标.
     * @param string|null $image image
     * @return static
     */
    public function setImage($image)
    {
        $this->image = null === $image ? null : (string)$image;
        return $this;
    }

    /**
     * 积分.
     * score
     * @Column(name="score", type="decimal", length=10, accuracy=2, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $score = NULL;

    /**
     * 获取 score - 积分.
     *
     * @return string|float|int|null
     */
    public function getScore()
    {
        return $this->score;
    }

    /**
     * 赋值 score - 积分.
     * @param string|float|int|null $score score
     * @return static
     */
    public function setScore($score)
    {
        $this->score = null === $score ? null : $score;
        return $this;
    }

    /**
     * 类型:2=每日任务,1=新生任务.
     * status
     * @Column(name="status", type="enum", length=0, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $status = NULL;

    /**
     * 获取 status - 类型:2=每日任务,1=新生任务.
     *
     * @return string|null
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * 赋值 status - 类型:2=每日任务,1=新生任务.
     * @param string|null $status status
     * @return static
     */
    public function setStatus($status)
    {
        $this->status = null === $status ? null : (string)$status;
        return $this;
    }

    /**
     * 积分类型:1=固定积分,2=区间积分.
     * rand_status
     * @Column(name="rand_status", type="enum", length=0, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $randStatus = '1';

    /**
     * 获取 randStatus - 积分类型:1=固定积分,2=区间积分.
     *
     * @return string|null
     */
    public function getRandStatus(): ?string
    {
        return $this->randStatus;
    }

    /**
     * 赋值 randStatus - 积分类型:1=固定积分,2=区间积分.
     * @param string|null $randStatus rand_status
     * @return static
     */
    public function setRandStatus($randStatus)
    {
        $this->randStatus = null === $randStatus ? null : (string)$randStatus;
        return $this;
    }

    /**
     * 区间积分.
     * range_score
     * @Column(name="range_score", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $rangeScore = NULL;

    /**
     * 获取 rangeScore - 区间积分.
     *
     * @return string|null
     */
    public function getRangeScore(): ?string
    {
        return $this->rangeScore;
    }

    /**
     * 赋值 rangeScore - 区间积分.
     * @param string|null $rangeScore range_score
     * @return static
     */
    public function setRangeScore($rangeScore)
    {
        $this->rangeScore = null === $rangeScore ? null : (string)$rangeScore;
        return $this;
    }

    /**
     * 排序.
     * weigh
     * @Column(name="weigh", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $weigh = NULL;

    /**
     * 获取 weigh - 排序.
     *
     * @return int|null
     */
    public function getWeigh(): ?int
    {
        return $this->weigh;
    }

    /**
     * 赋值 weigh - 排序.
     * @param int|null $weigh weigh
     * @return static
     */
    public function setWeigh($weigh)
    {
        $this->weigh = null === $weigh ? null : (int)$weigh;
        return $this;
    }

}
